package me.zhengjie.recitation.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import java.sql.Timestamp;
import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import me.zhengjie.poemmanager.domain.Comment;

/**
* @description /
* @author yellow
* @date 2025-04-06
**/
@Data
@TableName("recitation")
public class Recitation implements Serializable {

    @TableId(value = "recitation_id", type = IdType.AUTO)
    @ApiModelProperty(value = "朗诵记录ID")
    private Integer recitationId;

    @ApiModelProperty(value = "朗诵标题")
    private String title;

    @ApiModelProperty(value = "朗诵者ID")
    private Integer authorId;

    @ApiModelProperty("诗歌ID")
    private Integer poemId;

    @ApiModelProperty(value = "服务器存储路径")
    private String filePath;

    @ApiModelProperty(value = "录音文件路径")
    private String url;

    @ApiModelProperty(value = "朗诵内容")
    private String content;

    @ApiModelProperty(value = "上传用户名称")
    private String authorName;

    @ApiModelProperty(value = "创建时间")
    private Timestamp createdAt;

    @ApiModelProperty(value = "更新时间")
    private Timestamp updatedAt;

    @ApiModelProperty(value="关联诗歌标题")
    private String poemTitle;

    @ApiModelProperty(value = "收藏数")
    private Integer favoriteCount;
    @ApiModelProperty(value = "点赞数")
    private Integer likeCount;
    @ApiModelProperty(value = "评论数")
    private List<Comment> comments;
    @ApiModelProperty(value = "评论数")
    private Integer commentCount;

    public void copy(Recitation source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }

}
